import socket

ip_port = ('192.168.3.39', 7788)
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
client.sendto('begin'.encode('utf-8'), ip_port)
while 1:
    # msg = input('>>>：').strip()
    # if msg == 'q':
    #     break
    # if not msg:		# 其实，udp的套接字，支持客户端发空的，服务端也能收到空
    #     continue
    
    get_msg, server_addr = client.recvfrom(1024)
    print(get_msg.decode('utf-8'))       